#include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
using namespace cv;
using namespace std;


/// y = p1+p2*x + p3*x*x + p4*x*x*x  y 侧向方向  x 车头方向
struct LaneParam
{
    double p1;
    double p2;
    double p3;
    double p4;
    double range;
    int8_t quality; // 0-100取置信度
    int8_t type;//line_other 0 line_double 1 line_dash 2 line_solid 3
    int8_t position;//line_other 0 line_left 1 line_right 2 line_left_left 3 line_right_right 4
    int8_t color;// line_other 0 line_white 1 line_yellow 2 line_blue 3 line_green 4 line_fence 5 
};

Mat Polyfit(vector<Point>& in_point, int n);
std::vector<cv::Point3d> BubbleSort(std::vector<cv::Point3d> &array);
LaneParam CalcPolfit3(std::vector<std::pair<double,double>> points);
LaneParam CalcPolfit2(std::vector<std::pair<double,double>> points);
LaneParam CalcPolfit(std::vector<std::pair<double,double>> points);



